home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4472 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.6 KB

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: TMapping again!
  5. Date: 29 Feb 1996 12:17:08 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4h45g4$ije@sunsystem5.informatik.tu-muenchen.de>
  9. References: <38232442@kone.fipnet.fi> <xJSEnMD0aez4@point86.people-s.people.de> <38232567@kone.fipnet.fi>
  10. NNTP-Posting-Host: hphalle3g.informatik.tu-muenchen.de
  11. Originator: fischerj@hphalle3g.informatik.tu-muenchen.de
  12.  
  13.  
  14. In article <38232567@kone.fipnet.fi>, "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi> writes:
  15. |> 
  16. |> >     A time ago I did an approach to this problem using a similar trick
  17. |> >     than my two-command mapper.
  18. |> >     (btw. actually this one WORKS .. I have tried it out)
  19. |> > 
  20. |> > 
  21. |> >         move.l  d3,d2           ;d3=d4=0000000000000XXXXXXXxxxxxxYYYYYY
  22. |> >         move    d0,d5           ;d0=a6=yyyyyyyy000000000000BBBBBBbbbbbb
  23. |> >         and.l   d6,d2           ;d6=   00000000000001111111000000111111
  24. |> >         and.b   d7,d5           ;d7=   xxxxxxxxxxxxxxxxxxxxxxxx11000000
  25. |> >         or      d5,d2
  26. |> >         move.b  (a4,d2.l),(a2)+ ;d2=   00000000000000xxxxxxbbbbbbyyyyyy
  27. |> >         add.l   a6,d0
  28. |> >         addx.l  d4,d3
  29. |> > 
  30. |> >      This one is doing Texturemapping + gouraud shading with
  31. |> >      shadetable. (!!)
  32. |> > 
  33. |> >      The Texture is 64x64 (6 bit) and the shading is 6 bit two. You
  34. |> >      will need a 256k combined Texture/Shading table.
  35. |> 
  36. |> Hmm. Not nice in a game for example where several textures
  37. |> are needed. But a nice idea anyway!
  38.  
  39. nice ? Cooooooool! 
  40. Cool idea to pack the shading value into the texture adress!
  41.  
  42. The example does too much instructions :) but allows more general
  43. mem usage.
  44.  
  45. What about this...
  46.  
  47.  add.l  a2,d2          0...00BBBbbbbbbbbbbbbbbbb
  48.  add.l  a3,d1          x...xxxxxYYYYYYYYyyyyyyyy
  49.  addx.l d3,d0          0...0000000000000XXXXXXXX
  50.  move.l d2,d6
  51.  move.w d1,d6
  52.  move.b d0,d6
  53.  move.b 0(a0,d6.l),(a1)+
  54.  
  55. 20 cycles gouraud mapping :)
  56.  
  57. 8 shadingsteps are 512k, not too much even for a A1200 game imho 
  58. (well, people tell me they aim for higher machines anyway,
  59. so the mem consumption can't be considered so bad ;)
  60.  
  61. I would really think about using this routine, it's really LOT quicker.
  62. You can put multiple textures into a given 64k range btw. but those can't
  63. be "repeart-mapped" uh "multiplexed" ? how you call it if x gets 256 and then
  64. _plop_, 0 again on the left side ? Is this called bump-mapping ? :D
  65.  
  66.  
  67. |> 
  68. |> >      The Routine byself was a bit slower than ordenary Texturemapping.
  69. |> >      But should be a lot fast than to memery-accesses. And it uses only
  70. yeah!
  71.  
  72. |> >      two adds..
  73. |> 
  74. |> Yep .. well, normal optimized Texture/Gouraud with a shading table
  75. |> is ~76% slower than the fastest normal mapper .. I can live
  76.  
  77. boooh! means my A1201 doing speedomap will be as fast as a A3000 doing
  78. table-map. My tiny 14MHz cpu could run clones at the speed current
  79. clones run on a 030!
  80.  
  81. |> with it, no other restrictions execpt the 64k alignment.
  82.  
  83. Isn't it enough that average ami got less cpu than clones ?
  84. why do slower algos than known ?
  85. You can live with it as you got that 040/60, but average ami... ;)
  86.  
  87. |> 
  88. |> >      Speed could still be improved by aligned the table to a 256k
  89. |> >      border.
  90. |> 
  91. |> Yep, like using 64k aligned texture, to eliminate the indexed
  92. |> addressing.
  93. |> 
  94. |> --                               _
  95. |> a Stellar programmer          _ //
  96. |> "Amiga - back for the future" \X/
  97. ------------------------------------------------------------------------
  98.    fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  99.  
  100.